package BehavioralModel.ResponsibilityChainModel;

/**
 * @author 王蕾 [wanglei_dev@cyou-inc.com]
 * @date 2017-12-08 11:30:00
 */
public class Majordomo extends Manager {

    public Majordomo(String name) {
        super(name);
    }

    @Override
    public String getName() {
        return super.getName();
    }

    @Override
    public void setName(String name) {
        super.setName(name);
    }

    @Override
    public Manager getSuperior() {
        return super.getSuperior();
    }

    @Override
    public void setSuperior(Manager superior) {
        super.setSuperior(superior);
    }

    @Override
    void RequestApplication(Request request) {
        if ("请假".equals(request.getRequestType()) && request.getNumber()<= 5){
            System.out.println(this.getName()+"审批通过，请假"+request.getNumber()+"批准");
        }else {
            if (superior!=null){
                superior.RequestApplication(request);
            }
        }
    }
}
